from pathlib import Path
from typing import List
from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    # API 配置
    api_host: str = "0.0.0.0"
    api_port: int = 8000
    api_title: str = "MD2PPT API"
    api_version: str = "1.0.0"
    
    # MCP 配置
    mcp_host: str = "localhost"
    mcp_port: int = 8001
    
    # 存储配置
    storage_path: Path = Path("./storage")
    file_ttl: int = 3600  # 1小时
    max_file_size: int = 50 * 1024 * 1024  # 50MB
    
    # 转换配置
    default_theme: str = "default"
    supported_themes: List[str] = ["default", "blue", "dark", "minimal"]
    default_image_width_ratio: float = 0.7
    
    # 安全配置
    api_key: str = ""
    cors_origins: List[str] = ["*"]
    
    class Config:
        env_file = ".env"


settings = Settings()